\(\int \sec ^7(c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx\) [69]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F(-1)]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 28, antiderivative size = 120 \[ \int \sec ^7(c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=\frac {a^3 \tan (c+d x)}{d}+\frac {3 a^2 b \tan ^2(c+d x)}{2 d}+\frac {a \left (a^2+3 b^2\right ) \tan ^3(c+d x)}{3 d}+\frac {b \left (3 a^2+b^2\right ) \tan ^4(c+d x)}{4 d}+\frac {3 a b^2 \tan ^5(c+d x)}{5 d}+\frac {b^3 \tan ^6(c+d x)}{6 d} \]

[Out]

a^3*tan(d*x+c)/d+3/2*a^2*b*tan(d*x+c)^2/d+1/3*a*(a^2+3*b^2)*tan(d*x+c)^3/d+1/4*b*(3*a^2+b^2)*tan(d*x+c)^4/d+3/
5*a*b^2*tan(d*x+c)^5/d+1/6*b^3*tan(d*x+c)^6/d

Rubi [A] (verified)

Time = 0.13 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.071, Rules used = {3167, 908} \[ \int \sec ^7(c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=\frac {a^3 \tan (c+d x)}{d}+\frac {b \left (3 a^2+b^2\right ) \tan ^4(c+d x)}{4 d}+\frac {a \left (a^2+3 b^2\right ) \tan ^3(c+d x)}{3 d}+\frac {3 a^2 b \tan ^2(c+d x)}{2 d}+\frac {3 a b^2 \tan ^5(c+d x)}{5 d}+\frac {b^3 \tan ^6(c+d x)}{6 d} \]

[In]

Int[Sec[c + d*x]^7*(a*Cos[c + d*x] + b*Sin[c + d*x])^3,x]

[Out]

(a^3*Tan[c + d*x])/d + (3*a^2*b*Tan[c + d*x]^2)/(2*d) + (a*(a^2 + 3*b^2)*Tan[c + d*x]^3)/(3*d) + (b*(3*a^2 + b
^2)*Tan[c + d*x]^4)/(4*d) + (3*a*b^2*Tan[c + d*x]^5)/(5*d) + (b^3*Tan[c + d*x]^6)/(6*d)

Rule 908

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIn
tegrand[(d + e*x)^m*(f + g*x)^n*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[e*f - d*g, 0] &&
NeQ[c*d^2 + a*e^2, 0] && IntegerQ[p] && ((EqQ[p, 1] && IntegersQ[m, n]) || (ILtQ[m, 0] && ILtQ[n, 0]))

Rule 3167

Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symb
ol] :> Dist[-d^(-1), Subst[Int[x^m*((b + a*x)^n/(1 + x^2)^((m + n + 2)/2)), x], x, Cot[c + d*x]], x] /; FreeQ[
{a, b, c, d}, x] && IntegerQ[n] && IntegerQ[(m + n)/2] && NeQ[n, -1] &&  !(GtQ[n, 0] && GtQ[m, 1])

Rubi steps \begin{align*} \text {integral}& = -\frac {\text {Subst}\left (\int \frac {(b+a x)^3 \left (1+x^2\right )}{x^7} \, dx,x,\cot (c+d x)\right )}{d} \\ & = -\frac {\text {Subst}\left (\int \left (\frac {b^3}{x^7}+\frac {3 a b^2}{x^6}+\frac {3 a^2 b+b^3}{x^5}+\frac {a^3+3 a b^2}{x^4}+\frac {3 a^2 b}{x^3}+\frac {a^3}{x^2}\right ) \, dx,x,\cot (c+d x)\right )}{d} \\ & = \frac {a^3 \tan (c+d x)}{d}+\frac {3 a^2 b \tan ^2(c+d x)}{2 d}+\frac {a \left (a^2+3 b^2\right ) \tan ^3(c+d x)}{3 d}+\frac {b \left (3 a^2+b^2\right ) \tan ^4(c+d x)}{4 d}+\frac {3 a b^2 \tan ^5(c+d x)}{5 d}+\frac {b^3 \tan ^6(c+d x)}{6 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.37 (sec) , antiderivative size = 54, normalized size of antiderivative = 0.45 \[ \int \sec ^7(c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=\frac {(a+b \tan (c+d x))^4 \left (a^2+15 b^2-4 a b \tan (c+d x)+10 b^2 \tan ^2(c+d x)\right )}{60 b^3 d} \]

[In]

Integrate[Sec[c + d*x]^7*(a*Cos[c + d*x] + b*Sin[c + d*x])^3,x]

[Out]

((a + b*Tan[c + d*x])^4*(a^2 + 15*b^2 - 4*a*b*Tan[c + d*x] + 10*b^2*Tan[c + d*x]^2))/(60*b^3*d)

Maple [A] (verified)

Time = 1.29 (sec) , antiderivative size = 119, normalized size of antiderivative = 0.99

method result size
parts \(-\frac {a^{3} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )}{d}+\frac {b^{3} \left (\frac {\sec \left (d x +c \right )^{6}}{6}-\frac {\sec \left (d x +c \right )^{4}}{4}\right )}{d}+\frac {3 a \,b^{2} \left (\frac {\sin \left (d x +c \right )^{3}}{5 \cos \left (d x +c \right )^{5}}+\frac {2 \sin \left (d x +c \right )^{3}}{15 \cos \left (d x +c \right )^{3}}\right )}{d}+\frac {3 a^{2} b \sec \left (d x +c \right )^{4}}{4 d}\) \(119\)
derivativedivides \(\frac {-a^{3} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )+\frac {3 a^{2} b}{4 \cos \left (d x +c \right )^{4}}+3 a \,b^{2} \left (\frac {\sin \left (d x +c \right )^{3}}{5 \cos \left (d x +c \right )^{5}}+\frac {2 \sin \left (d x +c \right )^{3}}{15 \cos \left (d x +c \right )^{3}}\right )+b^{3} \left (\frac {\sin \left (d x +c \right )^{4}}{6 \cos \left (d x +c \right )^{6}}+\frac {\sin \left (d x +c \right )^{4}}{12 \cos \left (d x +c \right )^{4}}\right )}{d}\) \(127\)
default \(\frac {-a^{3} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )+\frac {3 a^{2} b}{4 \cos \left (d x +c \right )^{4}}+3 a \,b^{2} \left (\frac {\sin \left (d x +c \right )^{3}}{5 \cos \left (d x +c \right )^{5}}+\frac {2 \sin \left (d x +c \right )^{3}}{15 \cos \left (d x +c \right )^{3}}\right )+b^{3} \left (\frac {\sin \left (d x +c \right )^{4}}{6 \cos \left (d x +c \right )^{6}}+\frac {\sin \left (d x +c \right )^{4}}{12 \cos \left (d x +c \right )^{4}}\right )}{d}\) \(127\)
risch \(-\frac {4 \left (-15 i a^{3} {\mathrm e}^{8 i \left (d x +c \right )}+45 i a \,b^{2} {\mathrm e}^{8 i \left (d x +c \right )}-45 a^{2} b \,{\mathrm e}^{8 i \left (d x +c \right )}+15 b^{3} {\mathrm e}^{8 i \left (d x +c \right )}-50 i a^{3} {\mathrm e}^{6 i \left (d x +c \right )}+30 i a \,b^{2} {\mathrm e}^{6 i \left (d x +c \right )}-90 a^{2} b \,{\mathrm e}^{6 i \left (d x +c \right )}-10 b^{3} {\mathrm e}^{6 i \left (d x +c \right )}-60 i a^{3} {\mathrm e}^{4 i \left (d x +c \right )}-45 a^{2} b \,{\mathrm e}^{4 i \left (d x +c \right )}+15 b^{3} {\mathrm e}^{4 i \left (d x +c \right )}-30 i a^{3} {\mathrm e}^{2 i \left (d x +c \right )}+18 i a \,b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-5 i a^{3}+3 i a \,b^{2}\right )}{15 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{6}}\) \(228\)
parallelrisch \(-\frac {2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (15 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{10} a^{3}-45 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9} a^{2} b -55 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8} a^{3}+60 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8} a \,b^{2}+90 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7} a^{2} b -30 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7} b^{3}+90 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6} a^{3}-36 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6} a \,b^{2}-90 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5} a^{2} b -20 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5} b^{3}-90 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4} a^{3}+36 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4} a \,b^{2}+90 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3} a^{2} b -30 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3} b^{3}+55 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a^{3}-60 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a \,b^{2}-45 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) a^{2} b -15 a^{3}\right )}{15 d \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )^{6}}\) \(315\)

[In]

int(sec(d*x+c)^7*(cos(d*x+c)*a+b*sin(d*x+c))^3,x,method=_RETURNVERBOSE)

[Out]

-a^3/d*(-2/3-1/3*sec(d*x+c)^2)*tan(d*x+c)+b^3/d*(1/6*sec(d*x+c)^6-1/4*sec(d*x+c)^4)+3*a*b^2/d*(1/5*sin(d*x+c)^
3/cos(d*x+c)^5+2/15*sin(d*x+c)^3/cos(d*x+c)^3)+3/4*a^2*b/d*sec(d*x+c)^4

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 105, normalized size of antiderivative = 0.88 \[ \int \sec ^7(c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=\frac {10 \, b^{3} + 15 \, {\left (3 \, a^{2} b - b^{3}\right )} \cos \left (d x + c\right )^{2} + 4 \, {\left (2 \, {\left (5 \, a^{3} - 3 \, a b^{2}\right )} \cos \left (d x + c\right )^{5} + 9 \, a b^{2} \cos \left (d x + c\right ) + {\left (5 \, a^{3} - 3 \, a b^{2}\right )} \cos \left (d x + c\right )^{3}\right )} \sin \left (d x + c\right )}{60 \, d \cos \left (d x + c\right )^{6}} \]

[In]

integrate(sec(d*x+c)^7*(a*cos(d*x+c)+b*sin(d*x+c))^3,x, algorithm="fricas")

[Out]

1/60*(10*b^3 + 15*(3*a^2*b - b^3)*cos(d*x + c)^2 + 4*(2*(5*a^3 - 3*a*b^2)*cos(d*x + c)^5 + 9*a*b^2*cos(d*x + c
) + (5*a^3 - 3*a*b^2)*cos(d*x + c)^3)*sin(d*x + c))/(d*cos(d*x + c)^6)

Sympy [F(-1)]

Timed out. \[ \int \sec ^7(c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=\text {Timed out} \]

[In]

integrate(sec(d*x+c)**7*(a*cos(d*x+c)+b*sin(d*x+c))**3,x)

[Out]

Timed out

Maxima [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 122, normalized size of antiderivative = 1.02 \[ \int \sec ^7(c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=\frac {20 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} a^{3} + 12 \, {\left (3 \, \tan \left (d x + c\right )^{5} + 5 \, \tan \left (d x + c\right )^{3}\right )} a b^{2} - \frac {5 \, {\left (3 \, \sin \left (d x + c\right )^{2} - 1\right )} b^{3}}{\sin \left (d x + c\right )^{6} - 3 \, \sin \left (d x + c\right )^{4} + 3 \, \sin \left (d x + c\right )^{2} - 1} + \frac {45 \, a^{2} b}{{\left (\sin \left (d x + c\right )^{2} - 1\right )}^{2}}}{60 \, d} \]

[In]

integrate(sec(d*x+c)^7*(a*cos(d*x+c)+b*sin(d*x+c))^3,x, algorithm="maxima")

[Out]

1/60*(20*(tan(d*x + c)^3 + 3*tan(d*x + c))*a^3 + 12*(3*tan(d*x + c)^5 + 5*tan(d*x + c)^3)*a*b^2 - 5*(3*sin(d*x
 + c)^2 - 1)*b^3/(sin(d*x + c)^6 - 3*sin(d*x + c)^4 + 3*sin(d*x + c)^2 - 1) + 45*a^2*b/(sin(d*x + c)^2 - 1)^2)
/d

Giac [A] (verification not implemented)

none

Time = 0.39 (sec) , antiderivative size = 112, normalized size of antiderivative = 0.93 \[ \int \sec ^7(c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=\frac {10 \, b^{3} \tan \left (d x + c\right )^{6} + 36 \, a b^{2} \tan \left (d x + c\right )^{5} + 45 \, a^{2} b \tan \left (d x + c\right )^{4} + 15 \, b^{3} \tan \left (d x + c\right )^{4} + 20 \, a^{3} \tan \left (d x + c\right )^{3} + 60 \, a b^{2} \tan \left (d x + c\right )^{3} + 90 \, a^{2} b \tan \left (d x + c\right )^{2} + 60 \, a^{3} \tan \left (d x + c\right )}{60 \, d} \]

[In]

integrate(sec(d*x+c)^7*(a*cos(d*x+c)+b*sin(d*x+c))^3,x, algorithm="giac")

[Out]

1/60*(10*b^3*tan(d*x + c)^6 + 36*a*b^2*tan(d*x + c)^5 + 45*a^2*b*tan(d*x + c)^4 + 15*b^3*tan(d*x + c)^4 + 20*a
^3*tan(d*x + c)^3 + 60*a*b^2*tan(d*x + c)^3 + 90*a^2*b*tan(d*x + c)^2 + 60*a^3*tan(d*x + c))/d

Mupad [B] (verification not implemented)

Time = 22.48 (sec) , antiderivative size = 123, normalized size of antiderivative = 1.02 \[ \int \sec ^7(c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=\frac {{\cos \left (c+d\,x\right )}^3\,\left (\frac {a^3\,\sin \left (c+d\,x\right )}{3}-\frac {a\,b^2\,\sin \left (c+d\,x\right )}{5}\right )+{\cos \left (c+d\,x\right )}^5\,\left (\frac {2\,a^3\,\sin \left (c+d\,x\right )}{3}-\frac {2\,a\,b^2\,\sin \left (c+d\,x\right )}{5}\right )+{\cos \left (c+d\,x\right )}^2\,\left (\frac {3\,a^2\,b}{4}-\frac {b^3}{4}\right )+\frac {b^3}{6}+\frac {3\,a\,b^2\,\cos \left (c+d\,x\right )\,\sin \left (c+d\,x\right )}{5}}{d\,{\cos \left (c+d\,x\right )}^6} \]

[In]

int((a*cos(c + d*x) + b*sin(c + d*x))^3/cos(c + d*x)^7,x)

[Out]

(cos(c + d*x)^3*((a^3*sin(c + d*x))/3 - (a*b^2*sin(c + d*x))/5) + cos(c + d*x)^5*((2*a^3*sin(c + d*x))/3 - (2*
a*b^2*sin(c + d*x))/5) + cos(c + d*x)^2*((3*a^2*b)/4 - b^3/4) + b^3/6 + (3*a*b^2*cos(c + d*x)*sin(c + d*x))/5)
/(d*cos(c + d*x)^6)